import React, { Component } from 'react'
import { Link, Route } from 'react-router-dom'
import About from '../component/About'
import Home from '../component/Home'

export default class LinkMen extends Component {
  render() {
    return (
      <div>
          <div>
            {/* 在React中靠路由链接实现切换组件--编写路由链接 */}
            <Link to='/about'>About</Link>
            <Link to='/home'>home</Link>
          </div>
          <div>
            {/* 注册路由 */}
            <Route path='/about' component={About} />
            <Route path='/home' component={Home} />
          </div>
      </div>
    )
  }
}
